// 引入用来发送请求的方法
import { request } from "../../request/index.js";
wx - Page({

  /**
   * 页面的初始数据
   */
  data: {
    // 轮播图数组
    swiperList: [],
    hotGoods: []
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getSwiperList();
    this.getHotGoods();
  },
  async getSwiperList() {
    const result = await request({
      url: "/banners/queryBanner"
    })
    this.setData({
      swiperList: result.data.data
    })
  },
  async getHotGoods() {
    const result = await request({
      url: "/goods/queryHotGoods"
    })
    this.setData({
      hotGoods: result.data.data
    })
  }
})